package com.telit.android.controller;

import com.telit.android.service.TaskHomeService;
import com.telit.common.entity.DataReturn;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Auther amy
 * @Describe
 */
@RestController
@Api(tags = "首页接口-任务相关信息")
@RequestMapping("/home")
public class TaskHomeController {

    @Autowired
    private TaskHomeService taskHomeService;

//    @GetMapping(value = "/patrolAndCruise", produces = "application/json;charset=UTF-8")
//    @ApiModelProperty("首页-巡护/巡航总信息表")
//    public DataReturn patrolCount() {
//        return DataReturn.ok(taskHomeService.patrolAndCruiseInfoCount());
//    }

    @GetMapping(value = "/patrolAndCruise", produces = "application/json;charset=UTF-8")
    @ApiModelProperty("首页-巡护/巡航总信息表")
    public DataReturn patrolCount(@RequestParam("districtCode") String districtCode ) {
        return DataReturn.ok(taskHomeService.patrolAndCruiseInfoCountForNew(districtCode));
    }

}
